const webpack = require("webpack")
const Hwp = require("html-webpack-plugin")
const Ext = require("extract-text-webpack-plugin")

module.exports = {
    entry : __dirname + "/src/main.js",
    output : {
        path : __dirname + "/dist/",
        filename : "game.js"
    },
    devtool : "source-map",
    devServer : {
        contentBase : __dirname +"/dist/",
        port : 3000,
        inline : true
    },
    module : {
        rules : [
            {test:/\.less$/,loader:Ext.extract("css-loader!less-loader")},
            {test:/\.css$/,loader:Ext.extract("css-loader")},
            {test:/\.js$/,exclude:/node_modules/,loader:"babel-loader"},
        ]
    },
    plugins : [
        new Hwp({
            template : "index.html",
            filename : "index.html",
            inject : true
        }),
        new Ext("app.css")
    ]
}